import Vue from "vue";
import VueRouter from "vue-router";
import layout from "../layout";

Vue.use(VueRouter);

const routes = [{
    path: "/",
    name: "Project",
    component: () => import("@/pages/Project/index")
  }, 
  {
    path: "/project",
    name: "Layout",
    component: layout,
    redirect: "/project",
    children: [{
        path: "fields",
        name: "Fields",
        component: () => import("@/pages/Fields/index"),
        meta: {
          title: "首页"
        },
      },
      {
        path: "fields/edit",
        name: "FieldsEdit",
        component: () => import("@/pages/Fields/components/Edit.vue"),
        meta: {
          title: "首页"
        },
      }
    ],

  },

];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;